//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS XRay service.
///
/// Amazon Web Services X-Ray provides APIs for managing debug traces and retrieving service maps and other data created by processing those traces.
public struct XRay: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the XRay client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "XRay",
            serviceIdentifier: "xray",
            serviceProtocol: .restjson,
            apiVersion: "2016-04-12",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: XRayErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "xray-fips.us-east-1.amazonaws.com",
            "us-east-2": "xray-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "xray-fips.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "xray-fips.us-gov-west-1.amazonaws.com",
            "us-west-1": "xray-fips.us-west-1.amazonaws.com",
            "us-west-2": "xray-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    ///  You cannot find traces through this API if Transaction Search is enabled since trace is not indexed in X-Ray.  Retrieves a list of traces specified by ID. Each trace is a collection of segment documents that originates from a single request. Use GetTraceSummaries to get a list of trace IDs.
    @Sendable
    @inlinable
    public func batchGetTraces(_ input: BatchGetTracesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetTracesResult {
        try await self.client.execute(
            operation: "BatchGetTraces", 
            path: "/Traces", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  You cannot find traces through this API if Transaction Search is enabled since trace is not indexed in X-Ray.  Retrieves a list of traces specified by ID. Each trace is a collection of segment documents that originates from a single request. Use GetTraceSummaries to get a list of trace IDs.
    ///
    /// Parameters:
    ///   - nextToken: Pagination token.
    ///   - traceIds: Specify the trace IDs of requests for which to retrieve segments.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetTraces(
        nextToken: String? = nil,
        traceIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetTracesResult {
        let input = BatchGetTracesRequest(
            nextToken: nextToken, 
            traceIds: traceIds
        )
        return try await self.batchGetTraces(input, logger: logger)
    }

    /// Cancels an ongoing trace retrieval job initiated by StartTraceRetrieval using the provided RetrievalToken. A successful cancellation will return an HTTP 200 response.
    @Sendable
    @inlinable
    public func cancelTraceRetrieval(_ input: CancelTraceRetrievalRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelTraceRetrievalResult {
        try await self.client.execute(
            operation: "CancelTraceRetrieval", 
            path: "/CancelTraceRetrieval", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels an ongoing trace retrieval job initiated by StartTraceRetrieval using the provided RetrievalToken. A successful cancellation will return an HTTP 200 response.
    ///
    /// Parameters:
    ///   - retrievalToken: Retrieval token.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelTraceRetrieval(
        retrievalToken: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelTraceRetrievalResult {
        let input = CancelTraceRetrievalRequest(
            retrievalToken: retrievalToken
        )
        return try await self.cancelTraceRetrieval(input, logger: logger)
    }

    /// Creates a group resource with a name and a filter expression.
    @Sendable
    @inlinable
    public func createGroup(_ input: CreateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateGroupResult {
        try await self.client.execute(
            operation: "CreateGroup", 
            path: "/CreateGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a group resource with a name and a filter expression.
    ///
    /// Parameters:
    ///   - filterExpression: The filter expression defining criteria by which to group traces.
    ///   - groupName: The case-sensitive name of the new group. Default is a reserved name and names must be unique.
    ///   - insightsConfiguration: The structure containing configurations related to insights.   The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.   The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.
    ///   - tags: A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference. The following restrictions apply to tags:   Maximum number of user-applied tags per resource: 50   Maximum tag key length: 128 Unicode characters   Maximum tag value length: 256 Unicode characters   Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @   Tag keys and values are case sensitive.   Don't use aws: as a prefix for keys; it's reserved for Amazon Web Services use.
    ///   - logger: Logger use during operation
    @inlinable
    public func createGroup(
        filterExpression: String? = nil,
        groupName: String,
        insightsConfiguration: InsightsConfiguration? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateGroupResult {
        let input = CreateGroupRequest(
            filterExpression: filterExpression, 
            groupName: groupName, 
            insightsConfiguration: insightsConfiguration, 
            tags: tags
        )
        return try await self.createGroup(input, logger: logger)
    }

    /// Creates a rule to control sampling behavior for instrumented applications. Services retrieve rules with GetSamplingRules, and evaluate each rule in ascending order of priority for each request. If a rule matches, the service records a trace, borrowing it from the reservoir size. After 10 seconds, the service reports back to X-Ray with GetSamplingTargets to get updated versions of each in-use rule. The updated rule contains a trace quota that the service can use instead of borrowing from the reservoir.
    @Sendable
    @inlinable
    public func createSamplingRule(_ input: CreateSamplingRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateSamplingRuleResult {
        try await self.client.execute(
            operation: "CreateSamplingRule", 
            path: "/CreateSamplingRule", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a rule to control sampling behavior for instrumented applications. Services retrieve rules with GetSamplingRules, and evaluate each rule in ascending order of priority for each request. If a rule matches, the service records a trace, borrowing it from the reservoir size. After 10 seconds, the service reports back to X-Ray with GetSamplingTargets to get updated versions of each in-use rule. The updated rule contains a trace quota that the service can use instead of borrowing from the reservoir.
    ///
    /// Parameters:
    ///   - samplingRule: The rule definition.
    ///   - tags: A map that contains one or more tag keys and tag values to attach to an X-Ray sampling rule. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference. The following restrictions apply to tags:   Maximum number of user-applied tags per resource: 50   Maximum tag key length: 128 Unicode characters   Maximum tag value length: 256 Unicode characters   Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @   Tag keys and values are case sensitive.   Don't use aws: as a prefix for keys; it's reserved for Amazon Web Services use.
    ///   - logger: Logger use during operation
    @inlinable
    public func createSamplingRule(
        samplingRule: SamplingRule,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateSamplingRuleResult {
        let input = CreateSamplingRuleRequest(
            samplingRule: samplingRule, 
            tags: tags
        )
        return try await self.createSamplingRule(input, logger: logger)
    }

    /// Deletes a group resource.
    @Sendable
    @inlinable
    public func deleteGroup(_ input: DeleteGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGroupResult {
        try await self.client.execute(
            operation: "DeleteGroup", 
            path: "/DeleteGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a group resource.
    ///
    /// Parameters:
    ///   - groupARN: The ARN of the group that was generated on creation.
    ///   - groupName: The case-sensitive name of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGroup(
        groupARN: String? = nil,
        groupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGroupResult {
        let input = DeleteGroupRequest(
            groupARN: groupARN, 
            groupName: groupName
        )
        return try await self.deleteGroup(input, logger: logger)
    }

    /// Deletes a resource policy from the target Amazon Web Services account.
    @Sendable
    @inlinable
    public func deleteResourcePolicy(_ input: DeleteResourcePolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteResourcePolicyResult {
        try await self.client.execute(
            operation: "DeleteResourcePolicy", 
            path: "/DeleteResourcePolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a resource policy from the target Amazon Web Services account.
    ///
    /// Parameters:
    ///   - policyName: The name of the resource policy to delete.
    ///   - policyRevisionId: Specifies a specific policy revision to delete. Provide a PolicyRevisionId to ensure an atomic delete operation. If the provided revision id does  not match the latest policy revision id, an InvalidPolicyRevisionIdException exception is returned.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteResourcePolicy(
        policyName: String,
        policyRevisionId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteResourcePolicyResult {
        let input = DeleteResourcePolicyRequest(
            policyName: policyName, 
            policyRevisionId: policyRevisionId
        )
        return try await self.deleteResourcePolicy(input, logger: logger)
    }

    /// Deletes a sampling rule.
    @Sendable
    @inlinable
    public func deleteSamplingRule(_ input: DeleteSamplingRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteSamplingRuleResult {
        try await self.client.execute(
            operation: "DeleteSamplingRule", 
            path: "/DeleteSamplingRule", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a sampling rule.
    ///
    /// Parameters:
    ///   - ruleARN: The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
    ///   - ruleName: The name of the sampling rule. Specify a rule by either name or ARN, but not both.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteSamplingRule(
        ruleARN: String? = nil,
        ruleName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteSamplingRuleResult {
        let input = DeleteSamplingRuleRequest(
            ruleARN: ruleARN, 
            ruleName: ruleName
        )
        return try await self.deleteSamplingRule(input, logger: logger)
    }

    /// Retrieves the current encryption configuration for X-Ray data.
    @Sendable
    @inlinable
    public func getEncryptionConfig(_ input: GetEncryptionConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetEncryptionConfigResult {
        try await self.client.execute(
            operation: "GetEncryptionConfig", 
            path: "/EncryptionConfig", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the current encryption configuration for X-Ray data.
    ///
    /// Parameters:
    ///   - logger: Logger use during operation
    @inlinable
    public func getEncryptionConfig(
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetEncryptionConfigResult {
        let input = GetEncryptionConfigRequest(
        )
        return try await self.getEncryptionConfig(input, logger: logger)
    }

    /// Retrieves group resource details.
    @Sendable
    @inlinable
    public func getGroup(_ input: GetGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetGroupResult {
        try await self.client.execute(
            operation: "GetGroup", 
            path: "/GetGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves group resource details.
    ///
    /// Parameters:
    ///   - groupARN: The ARN of the group that was generated on creation.
    ///   - groupName: The case-sensitive name of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func getGroup(
        groupARN: String? = nil,
        groupName: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetGroupResult {
        let input = GetGroupRequest(
            groupARN: groupARN, 
            groupName: groupName
        )
        return try await self.getGroup(input, logger: logger)
    }

    /// Retrieves all active group details.
    @Sendable
    @inlinable
    public func getGroups(_ input: GetGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetGroupsResult {
        try await self.client.execute(
            operation: "GetGroups", 
            path: "/Groups", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all active group details.
    ///
    /// Parameters:
    ///   - nextToken: Pagination token.
    ///   - logger: Logger use during operation
    @inlinable
    public func getGroups(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetGroupsResult {
        let input = GetGroupsRequest(
            nextToken: nextToken
        )
        return try await self.getGroups(input, logger: logger)
    }

    /// Retrieves all indexing rules. Indexing rules are used to determine the server-side sampling rate for spans ingested through the CloudWatchLogs destination and indexed by X-Ray. For more information, see Transaction Search.
    @Sendable
    @inlinable
    public func getIndexingRules(_ input: GetIndexingRulesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetIndexingRulesResult {
        try await self.client.execute(
            operation: "GetIndexingRules", 
            path: "/GetIndexingRules", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all indexing rules. Indexing rules are used to determine the server-side sampling rate for spans ingested through the CloudWatchLogs destination and indexed by X-Ray. For more information, see Transaction Search.
    ///
    /// Parameters:
    ///   - nextToken: Specify the pagination token returned by a previous request to retrieve the next page of indexes.
    ///   - logger: Logger use during operation
    @inlinable
    public func getIndexingRules(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetIndexingRulesResult {
        let input = GetIndexingRulesRequest(
            nextToken: nextToken
        )
        return try await self.getIndexingRules(input, logger: logger)
    }

    /// Retrieves the summary information of an insight. This includes impact to clients and root cause services, the top anomalous services, the category, the state of the insight, and the start and end time of the insight.
    @Sendable
    @inlinable
    public func getInsight(_ input: GetInsightRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetInsightResult {
        try await self.client.execute(
            operation: "GetInsight", 
            path: "/Insight", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the summary information of an insight. This includes impact to clients and root cause services, the top anomalous services, the category, the state of the insight, and the start and end time of the insight.
    ///
    /// Parameters:
    ///   - insightId: The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
    ///   - logger: Logger use during operation
    @inlinable
    public func getInsight(
        insightId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetInsightResult {
        let input = GetInsightRequest(
            insightId: insightId
        )
        return try await self.getInsight(input, logger: logger)
    }

    /// X-Ray reevaluates insights periodically until they're resolved, and records each intermediate state as an event. You can review an insight's events in the Impact Timeline on the Inspect page in the X-Ray console.
    @Sendable
    @inlinable
    public func getInsightEvents(_ input: GetInsightEventsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetInsightEventsResult {
        try await self.client.execute(
            operation: "GetInsightEvents", 
            path: "/InsightEvents", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// X-Ray reevaluates insights periodically until they're resolved, and records each intermediate state as an event. You can review an insight's events in the Impact Timeline on the Inspect page in the X-Ray console.
    ///
    /// Parameters:
    ///   - insightId: The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
    ///   - maxResults: Used to retrieve at most the specified value of events.
    ///   - nextToken: Specify the pagination token returned by a previous request to retrieve the next page of events.
    ///   - logger: Logger use during operation
    @inlinable
    public func getInsightEvents(
        insightId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetInsightEventsResult {
        let input = GetInsightEventsRequest(
            insightId: insightId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.getInsightEvents(input, logger: logger)
    }

    /// Retrieves a service graph structure filtered by the specified insight. The service graph is limited to only structural information. For a complete service graph, use this API with the GetServiceGraph API.
    @Sendable
    @inlinable
    public func getInsightImpactGraph(_ input: GetInsightImpactGraphRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetInsightImpactGraphResult {
        try await self.client.execute(
            operation: "GetInsightImpactGraph", 
            path: "/InsightImpactGraph", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a service graph structure filtered by the specified insight. The service graph is limited to only structural information. For a complete service graph, use this API with the GetServiceGraph API.
    ///
    /// Parameters:
    ///   - endTime: The estimated end time of the insight, in Unix time seconds. The EndTime is exclusive of the value provided. The time range between the start time and end time can't be more than six hours.
    ///   - insightId: The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
    ///   - nextToken: Specify the pagination token returned by a previous request to retrieve the next page of results.
    ///   - startTime: The estimated start time of the insight, in Unix time seconds. The StartTime is inclusive of the value provided and can't be more than 30 days old.
    ///   - logger: Logger use during operation
    @inlinable
    public func getInsightImpactGraph(
        endTime: Date,
        insightId: String,
        nextToken: String? = nil,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetInsightImpactGraphResult {
        let input = GetInsightImpactGraphRequest(
            endTime: endTime, 
            insightId: insightId, 
            nextToken: nextToken, 
            startTime: startTime
        )
        return try await self.getInsightImpactGraph(input, logger: logger)
    }

    /// Retrieves the summaries of all insights in the specified group matching the provided filter values.
    @Sendable
    @inlinable
    public func getInsightSummaries(_ input: GetInsightSummariesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetInsightSummariesResult {
        try await self.client.execute(
            operation: "GetInsightSummaries", 
            path: "/InsightSummaries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the summaries of all insights in the specified group matching the provided filter values.
    ///
    /// Parameters:
    ///   - endTime: The end of the time frame in which the insights ended. The end time can't be more than 30 days old.
    ///   - groupARN: The Amazon Resource Name (ARN) of the group. Required if the GroupName isn't provided.
    ///   - groupName: The name of the group. Required if the GroupARN isn't provided.
    ///   - maxResults: The maximum number of results to display.
    ///   - nextToken: Pagination token.
    ///   - startTime: The beginning of the time frame in which the insights started. The start time can't be more than 30 days old.
    ///   - states: The list of insight states.
    ///   - logger: Logger use during operation
    @inlinable
    public func getInsightSummaries(
        endTime: Date,
        groupARN: String? = nil,
        groupName: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        startTime: Date,
        states: [InsightState]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetInsightSummariesResult {
        let input = GetInsightSummariesRequest(
            endTime: endTime, 
            groupARN: groupARN, 
            groupName: groupName, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            startTime: startTime, 
            states: states
        )
        return try await self.getInsightSummaries(input, logger: logger)
    }

    ///  Retrieves a service graph for traces based on the specified RetrievalToken from the CloudWatch log group generated by Transaction Search. This API does not initiate a retrieval job. You must first execute StartTraceRetrieval to obtain the required RetrievalToken.
    ///  The trace graph describes services that process incoming requests and any downstream services they call, which may include Amazon Web Services resources, external APIs, or databases. The response is empty until the RetrievalStatus is COMPLETE. Retry the request after the status changes from RUNNING or SCHEDULED to COMPLETE to access the full service graph.  When CloudWatch log is the destination, this API can support cross-account observability and service graph retrieval across linked accounts. For retrieving graphs from X-Ray directly as opposed to the Transaction-Search Log group, see GetTraceGraph.
    @Sendable
    @inlinable
    public func getRetrievedTracesGraph(_ input: GetRetrievedTracesGraphRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetRetrievedTracesGraphResult {
        try await self.client.execute(
            operation: "GetRetrievedTracesGraph", 
            path: "/GetRetrievedTracesGraph", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Retrieves a service graph for traces based on the specified RetrievalToken from the CloudWatch log group generated by Transaction Search. This API does not initiate a retrieval job. You must first execute StartTraceRetrieval to obtain the required RetrievalToken.
    ///  The trace graph describes services that process incoming requests and any downstream services they call, which may include Amazon Web Services resources, external APIs, or databases. The response is empty until the RetrievalStatus is COMPLETE. Retry the request after the status changes from RUNNING or SCHEDULED to COMPLETE to access the full service graph.  When CloudWatch log is the destination, this API can support cross-account observability and service graph retrieval across linked accounts. For retrieving graphs from X-Ray directly as opposed to the Transaction-Search Log group, see GetTraceGraph.
    ///
    /// Parameters:
    ///   - nextToken:  Specify the pagination token returned by a previous request to retrieve the next page of indexes.
    ///   - retrievalToken:  Retrieval token.
    ///   - logger: Logger use during operation
    @inlinable
    public func getRetrievedTracesGraph(
        nextToken: String? = nil,
        retrievalToken: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetRetrievedTracesGraphResult {
        let input = GetRetrievedTracesGraphRequest(
            nextToken: nextToken, 
            retrievalToken: retrievalToken
        )
        return try await self.getRetrievedTracesGraph(input, logger: logger)
    }

    /// Retrieves all sampling rules.
    @Sendable
    @inlinable
    public func getSamplingRules(_ input: GetSamplingRulesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSamplingRulesResult {
        try await self.client.execute(
            operation: "GetSamplingRules", 
            path: "/GetSamplingRules", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all sampling rules.
    ///
    /// Parameters:
    ///   - nextToken: Pagination token.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSamplingRules(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSamplingRulesResult {
        let input = GetSamplingRulesRequest(
            nextToken: nextToken
        )
        return try await self.getSamplingRules(input, logger: logger)
    }

    /// Retrieves information about recent sampling results for all sampling rules.
    @Sendable
    @inlinable
    public func getSamplingStatisticSummaries(_ input: GetSamplingStatisticSummariesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSamplingStatisticSummariesResult {
        try await self.client.execute(
            operation: "GetSamplingStatisticSummaries", 
            path: "/SamplingStatisticSummaries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves information about recent sampling results for all sampling rules.
    ///
    /// Parameters:
    ///   - nextToken: Pagination token.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSamplingStatisticSummaries(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSamplingStatisticSummariesResult {
        let input = GetSamplingStatisticSummariesRequest(
            nextToken: nextToken
        )
        return try await self.getSamplingStatisticSummaries(input, logger: logger)
    }

    /// Requests a sampling quota for rules that the service is using to sample requests.
    @Sendable
    @inlinable
    public func getSamplingTargets(_ input: GetSamplingTargetsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSamplingTargetsResult {
        try await self.client.execute(
            operation: "GetSamplingTargets", 
            path: "/SamplingTargets", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Requests a sampling quota for rules that the service is using to sample requests.
    ///
    /// Parameters:
    ///   - samplingStatisticsDocuments: Information about rules that the service is using to sample requests.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSamplingTargets(
        samplingStatisticsDocuments: [SamplingStatisticsDocument],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSamplingTargetsResult {
        let input = GetSamplingTargetsRequest(
            samplingStatisticsDocuments: samplingStatisticsDocuments
        )
        return try await self.getSamplingTargets(input, logger: logger)
    }

    /// Retrieves a document that describes services that process incoming requests, and downstream services that they call as a result. Root services process incoming requests and make calls to downstream services. Root services are applications that use the Amazon Web Services X-Ray SDK. Downstream services can be other applications, Amazon Web Services resources, HTTP web APIs, or SQL databases.
    @Sendable
    @inlinable
    public func getServiceGraph(_ input: GetServiceGraphRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetServiceGraphResult {
        try await self.client.execute(
            operation: "GetServiceGraph", 
            path: "/ServiceGraph", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a document that describes services that process incoming requests, and downstream services that they call as a result. Root services process incoming requests and make calls to downstream services. Root services are applications that use the Amazon Web Services X-Ray SDK. Downstream services can be other applications, Amazon Web Services resources, HTTP web APIs, or SQL databases.
    ///
    /// Parameters:
    ///   - endTime: The end of the timeframe for which to generate a graph.
    ///   - groupARN: The Amazon Resource Name (ARN) of a group based on which you want to generate a graph.
    ///   - groupName: The name of a group based on which you want to generate a graph.
    ///   - nextToken: Pagination token.
    ///   - startTime: The start of the time frame for which to generate a graph.
    ///   - logger: Logger use during operation
    @inlinable
    public func getServiceGraph(
        endTime: Date,
        groupARN: String? = nil,
        groupName: String? = nil,
        nextToken: String? = nil,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetServiceGraphResult {
        let input = GetServiceGraphRequest(
            endTime: endTime, 
            groupARN: groupARN, 
            groupName: groupName, 
            nextToken: nextToken, 
            startTime: startTime
        )
        return try await self.getServiceGraph(input, logger: logger)
    }

    /// Get an aggregation of service statistics defined by a specific time range.
    @Sendable
    @inlinable
    public func getTimeSeriesServiceStatistics(_ input: GetTimeSeriesServiceStatisticsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTimeSeriesServiceStatisticsResult {
        try await self.client.execute(
            operation: "GetTimeSeriesServiceStatistics", 
            path: "/TimeSeriesServiceStatistics", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get an aggregation of service statistics defined by a specific time range.
    ///
    /// Parameters:
    ///   - endTime: The end of the time frame for which to aggregate statistics.
    ///   - entitySelectorExpression: A filter expression defining entities that will be aggregated for statistics. Supports ID, service, and edge functions. If no selector expression is specified, edge statistics are returned.
    ///   - forecastStatistics: The forecasted high and low fault count values. Forecast enabled requests require the EntitySelectorExpression ID be provided.
    ///   - groupARN: The Amazon Resource Name (ARN) of the group for which to pull statistics from.
    ///   - groupName: The case-sensitive name of the group for which to pull statistics from.
    ///   - nextToken: Pagination token.
    ///   - period: Aggregation period in seconds.
    ///   - startTime: The start of the time frame for which to aggregate statistics.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTimeSeriesServiceStatistics(
        endTime: Date,
        entitySelectorExpression: String? = nil,
        forecastStatistics: Bool? = nil,
        groupARN: String? = nil,
        groupName: String? = nil,
        nextToken: String? = nil,
        period: Int? = nil,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTimeSeriesServiceStatisticsResult {
        let input = GetTimeSeriesServiceStatisticsRequest(
            endTime: endTime, 
            entitySelectorExpression: entitySelectorExpression, 
            forecastStatistics: forecastStatistics, 
            groupARN: groupARN, 
            groupName: groupName, 
            nextToken: nextToken, 
            period: period, 
            startTime: startTime
        )
        return try await self.getTimeSeriesServiceStatistics(input, logger: logger)
    }

    /// Retrieves a service graph for one or more specific trace IDs.
    @Sendable
    @inlinable
    public func getTraceGraph(_ input: GetTraceGraphRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTraceGraphResult {
        try await self.client.execute(
            operation: "GetTraceGraph", 
            path: "/TraceGraph", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a service graph for one or more specific trace IDs.
    ///
    /// Parameters:
    ///   - nextToken: Pagination token.
    ///   - traceIds: Trace IDs of requests for which to generate a service graph.
    ///   - logger: Logger use during operation
    @inlinable
    public func getTraceGraph(
        nextToken: String? = nil,
        traceIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTraceGraphResult {
        let input = GetTraceGraphRequest(
            nextToken: nextToken, 
            traceIds: traceIds
        )
        return try await self.getTraceGraph(input, logger: logger)
    }

    ///  Retrieves the current destination of data sent to PutTraceSegments and OpenTelemetry API. The Transaction Search feature requires a CloudWatchLogs destination. For more information, see Transaction Search and OpenTelemetry.
    @Sendable
    @inlinable
    public func getTraceSegmentDestination(_ input: GetTraceSegmentDestinationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTraceSegmentDestinationResult {
        try await self.client.execute(
            operation: "GetTraceSegmentDestination", 
            path: "/GetTraceSegmentDestination", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Retrieves the current destination of data sent to PutTraceSegments and OpenTelemetry API. The Transaction Search feature requires a CloudWatchLogs destination. For more information, see Transaction Search and OpenTelemetry.
    ///
    /// Parameters:
    ///   - logger: Logger use during operation
    @inlinable
    public func getTraceSegmentDestination(
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTraceSegmentDestinationResult {
        let input = GetTraceSegmentDestinationRequest(
        )
        return try await self.getTraceSegmentDestination(input, logger: logger)
    }

    /// Retrieves IDs and annotations for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces. A filter expression can target traced requests that hit specific service nodes or edges, have errors, or come from a known user. For example, the following filter expression targets traces that pass through api.example.com:  service("api.example.com")  This filter expression finds traces that have an annotation named account with the value 12345:  annotation.account = "12345"  For a full list of indexed fields and keywords that you can use in filter expressions, see Use filter expressions in the Amazon Web Services X-Ray Developer Guide.
    @Sendable
    @inlinable
    public func getTraceSummaries(_ input: GetTraceSummariesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetTraceSummariesResult {
        try await self.client.execute(
            operation: "GetTraceSummaries", 
            path: "/TraceSummaries", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves IDs and annotations for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces. A filter expression can target traced requests that hit specific service nodes or edges, have errors, or come from a known user. For example, the following filter expression targets traces that pass through api.example.com:  service("api.example.com")  This filter expression finds traces that have an annotation named account with the value 12345:  annotation.account = "12345"  For a full list of indexed fields and keywords that you can use in filter expressions, see Use filter expressions in the Amazon Web Services X-Ray Developer Guide.
    ///
    /// Parameters:
    ///   - endTime: The end of the time frame for which to retrieve traces.
    ///   - filterExpression: Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.
    ///   - nextToken: Specify the pagination token returned by a previous request to retrieve the next page of results.
    ///   - sampling: Set to true to get summaries for only a subset of available traces.
    ///   - samplingStrategy: A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.
    ///   - startTime: The start of the time frame for which to retrieve traces.
    ///   - timeRangeType: Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).
    ///   - logger: Logger use during operation
    @inlinable
    public func getTraceSummaries(
        endTime: Date,
        filterExpression: String? = nil,
        nextToken: String? = nil,
        sampling: Bool? = nil,
        samplingStrategy: SamplingStrategy? = nil,
        startTime: Date,
        timeRangeType: TimeRangeType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetTraceSummariesResult {
        let input = GetTraceSummariesRequest(
            endTime: endTime, 
            filterExpression: filterExpression, 
            nextToken: nextToken, 
            sampling: sampling, 
            samplingStrategy: samplingStrategy, 
            startTime: startTime, 
            timeRangeType: timeRangeType
        )
        return try await self.getTraceSummaries(input, logger: logger)
    }

    /// Returns the list of resource policies in the target Amazon Web Services account.
    @Sendable
    @inlinable
    public func listResourcePolicies(_ input: ListResourcePoliciesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListResourcePoliciesResult {
        try await self.client.execute(
            operation: "ListResourcePolicies", 
            path: "/ListResourcePolicies", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the list of resource policies in the target Amazon Web Services account.
    ///
    /// Parameters:
    ///   - nextToken: Not currently supported.
    ///   - logger: Logger use during operation
    @inlinable
    public func listResourcePolicies(
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListResourcePoliciesResult {
        let input = ListResourcePoliciesRequest(
            nextToken: nextToken
        )
        return try await self.listResourcePolicies(input, logger: logger)
    }

    ///  Retrieves a list of traces for a given RetrievalToken from the CloudWatch log group generated by Transaction Search. For information on what each trace returns, see BatchGetTraces.
    ///  This API does not initiate a retrieval job. To start a trace retrieval, use StartTraceRetrieval, which generates the required RetrievalToken.  When the RetrievalStatus is not COMPLETE, the API will return an empty response. Retry the request once the retrieval has completed to access the full list of traces. For cross-account observability, this API can retrieve traces from linked accounts when CloudWatch log is the destination across relevant accounts. For more details, see CloudWatch cross-account observability. For retrieving data from X-Ray directly as opposed to the Transaction-Search Log group, see BatchGetTraces.
    @Sendable
    @inlinable
    public func listRetrievedTraces(_ input: ListRetrievedTracesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRetrievedTracesResult {
        try await self.client.execute(
            operation: "ListRetrievedTraces", 
            path: "/ListRetrievedTraces", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Retrieves a list of traces for a given RetrievalToken from the CloudWatch log group generated by Transaction Search. For information on what each trace returns, see BatchGetTraces.
    ///  This API does not initiate a retrieval job. To start a trace retrieval, use StartTraceRetrieval, which generates the required RetrievalToken.  When the RetrievalStatus is not COMPLETE, the API will return an empty response. Retry the request once the retrieval has completed to access the full list of traces. For cross-account observability, this API can retrieve traces from linked accounts when CloudWatch log is the destination across relevant accounts. For more details, see CloudWatch cross-account observability. For retrieving data from X-Ray directly as opposed to the Transaction-Search Log group, see BatchGetTraces.
    ///
    /// Parameters:
    ///   - nextToken:  Specify the pagination token returned by a previous request to retrieve the next page of indexes.
    ///   - retrievalToken: Retrieval token.
    ///   - traceFormat: Format of the requested traces.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRetrievedTraces(
        nextToken: String? = nil,
        retrievalToken: String,
        traceFormat: TraceFormatType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRetrievedTracesResult {
        let input = ListRetrievedTracesRequest(
            nextToken: nextToken, 
            retrievalToken: retrievalToken, 
            traceFormat: traceFormat
        )
        return try await self.listRetrievedTraces(input, logger: logger)
    }

    /// Returns a list of tags that are applied to the specified Amazon Web Services X-Ray group or sampling rule.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/ListTagsForResource", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of tags that are applied to the specified Amazon Web Services X-Ray group or sampling rule.
    ///
    /// Parameters:
    ///   - nextToken: A pagination token. If multiple pages of results are returned, use the NextToken value returned with  the current page of results as the value of this parameter to get the next page of results.
    ///   - resourceARN: The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        nextToken: String? = nil,
        resourceARN: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            nextToken: nextToken, 
            resourceARN: resourceARN
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Updates the encryption configuration for X-Ray data.
    @Sendable
    @inlinable
    public func putEncryptionConfig(_ input: PutEncryptionConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutEncryptionConfigResult {
        try await self.client.execute(
            operation: "PutEncryptionConfig", 
            path: "/PutEncryptionConfig", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the encryption configuration for X-Ray data.
    ///
    /// Parameters:
    ///   - keyId: An Amazon Web Services KMS key in one of the following formats:    Alias - The name of the key. For example, alias/MyKey.    Key ID - The KMS key ID of the key. For example, ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. Amazon Web Services X-Ray does not support asymmetric KMS keys.    ARN - The full Amazon Resource Name of the key ID or alias. For example, arn:aws:kms:us-east-2:123456789012:key/ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. Use this format to specify a key in a different account.   Omit this key if you set Type to NONE.
    ///   - type: The type of encryption. Set to KMS to use your own key for encryption. Set to NONE for default encryption.
    ///   - logger: Logger use during operation
    @inlinable
    public func putEncryptionConfig(
        keyId: String? = nil,
        type: EncryptionType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutEncryptionConfigResult {
        let input = PutEncryptionConfigRequest(
            keyId: keyId, 
            type: type
        )
        return try await self.putEncryptionConfig(input, logger: logger)
    }

    ///  Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to  access X-Ray. Each resource policy will be associated with a specific Amazon Web Services account.  Each Amazon Web Services account can have a maximum of 5 resource policies, and each policy name must be  unique within that account. The maximum size of each resource policy is 5KB.
    @Sendable
    @inlinable
    public func putResourcePolicy(_ input: PutResourcePolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutResourcePolicyResult {
        try await self.client.execute(
            operation: "PutResourcePolicy", 
            path: "/PutResourcePolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to  access X-Ray. Each resource policy will be associated with a specific Amazon Web Services account.  Each Amazon Web Services account can have a maximum of 5 resource policies, and each policy name must be  unique within that account. The maximum size of each resource policy is 5KB.
    ///
    /// Parameters:
    ///   - bypassPolicyLockoutCheck: A flag to indicate whether to bypass the resource policy lockout safety check.  Setting this value to true increases the risk that the policy becomes unmanageable. Do not set this value to true indiscriminately.  Use this parameter only when you include a policy in the request and you intend to prevent the principal that is making the request from making a subsequent PutResourcePolicy request. The default value is false.
    ///   - policyDocument: The resource policy document, which can be up to 5kb in size.
    ///   - policyName: The name of the resource policy. Must be unique within a specific Amazon Web Services account.
    ///   - policyRevisionId: Specifies a specific policy revision, to ensure an atomic create operation. By default the resource policy is created if it does not exist, or updated with an incremented revision id.  The revision id is unique to each policy in the account. If the policy revision id does not match the latest revision id, the operation will fail with an InvalidPolicyRevisionIdException exception. You can also provide a  PolicyRevisionId of 0. In this case, the operation will fail with an InvalidPolicyRevisionIdException exception if a resource policy with the same name already exists.
    ///   - logger: Logger use during operation
    @inlinable
    public func putResourcePolicy(
        bypassPolicyLockoutCheck: Bool? = nil,
        policyDocument: String,
        policyName: String,
        policyRevisionId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutResourcePolicyResult {
        let input = PutResourcePolicyRequest(
            bypassPolicyLockoutCheck: bypassPolicyLockoutCheck, 
            policyDocument: policyDocument, 
            policyName: policyName, 
            policyRevisionId: policyRevisionId
        )
        return try await self.putResourcePolicy(input, logger: logger)
    }

    /// Used by the Amazon Web Services X-Ray daemon to upload telemetry.
    @Sendable
    @inlinable
    public func putTelemetryRecords(_ input: PutTelemetryRecordsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutTelemetryRecordsResult {
        try await self.client.execute(
            operation: "PutTelemetryRecords", 
            path: "/TelemetryRecords", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Used by the Amazon Web Services X-Ray daemon to upload telemetry.
    ///
    /// Parameters:
    ///   - ec2InstanceId: 
    ///   - hostname: 
    ///   - resourceARN: 
    ///   - telemetryRecords: 
    ///   - logger: Logger use during operation
    @inlinable
    public func putTelemetryRecords(
        ec2InstanceId: String? = nil,
        hostname: String? = nil,
        resourceARN: String? = nil,
        telemetryRecords: [TelemetryRecord],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutTelemetryRecordsResult {
        let input = PutTelemetryRecordsRequest(
            ec2InstanceId: ec2InstanceId, 
            hostname: hostname, 
            resourceARN: resourceARN, 
            telemetryRecords: telemetryRecords
        )
        return try await self.putTelemetryRecords(input, logger: logger)
    }

    /// Uploads segment documents to Amazon Web Services X-Ray.  A segment document can be a completed segment, an in-progress segment, or an array of subsegments. Segments must include the following fields. For the full segment document schema, see Amazon Web Services X-Ray Segment Documents in the Amazon Web Services X-Ray Developer Guide.  Required segment document fields     name - The name of the service that handled the request.    id - A 64-bit identifier for the segment, unique among segments in the same trace, in 16 hexadecimal digits.    trace_id - A unique identifier that connects all segments and subsegments originating from a single client request.    start_time - Time the segment or subsegment was created, in floating point seconds in epoch time, accurate to milliseconds. For example, 1480615200.010 or 1.480615200010E9.    end_time - Time the segment or subsegment was closed. For example, 1480615200.090 or 1.480615200090E9. Specify either an end_time or in_progress.    in_progress - Set to true instead of specifying an end_time to record that a segment has been started, but is not complete. Send an in-progress segment when your application receives a request that will take a long time to serve, to trace that the request was received. When the response is sent, send the complete segment to overwrite the in-progress segment.   A trace_id consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979. For trace IDs created by an X-Ray SDK, or by Amazon Web Services services  integrated with X-Ray, a trace ID includes:  Trace ID Format    The version number, for instance, 1.   The time of the original request, in Unix epoch time, in 8 hexadecimal digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is 1480615200 seconds, or 58406520 in hexadecimal.   A 96-bit identifier for the trace, globally unique, in 24 hexadecimal digits.    Trace IDs created via OpenTelemetry have a different format based on the  W3C Trace Context specification. A W3C trace ID must be formatted in the X-Ray trace ID format when sending to X-Ray. For example, a W3C trace ID 4efaaf4d1e8720b39541901950019ee5 should be formatted as  1-4efaaf4d-1e8720b39541901950019ee5 when sending to X-Ray. While X-Ray trace IDs include  the original request timestamp in Unix epoch time, this is not required or validated.
    @Sendable
    @inlinable
    public func putTraceSegments(_ input: PutTraceSegmentsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutTraceSegmentsResult {
        try await self.client.execute(
            operation: "PutTraceSegments", 
            path: "/TraceSegments", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Uploads segment documents to Amazon Web Services X-Ray.  A segment document can be a completed segment, an in-progress segment, or an array of subsegments. Segments must include the following fields. For the full segment document schema, see Amazon Web Services X-Ray Segment Documents in the Amazon Web Services X-Ray Developer Guide.  Required segment document fields     name - The name of the service that handled the request.    id - A 64-bit identifier for the segment, unique among segments in the same trace, in 16 hexadecimal digits.    trace_id - A unique identifier that connects all segments and subsegments originating from a single client request.    start_time - Time the segment or subsegment was created, in floating point seconds in epoch time, accurate to milliseconds. For example, 1480615200.010 or 1.480615200010E9.    end_time - Time the segment or subsegment was closed. For example, 1480615200.090 or 1.480615200090E9. Specify either an end_time or in_progress.    in_progress - Set to true instead of specifying an end_time to record that a segment has been started, but is not complete. Send an in-progress segment when your application receives a request that will take a long time to serve, to trace that the request was received. When the response is sent, send the complete segment to overwrite the in-progress segment.   A trace_id consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979. For trace IDs created by an X-Ray SDK, or by Amazon Web Services services  integrated with X-Ray, a trace ID includes:  Trace ID Format    The version number, for instance, 1.   The time of the original request, in Unix epoch time, in 8 hexadecimal digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is 1480615200 seconds, or 58406520 in hexadecimal.   A 96-bit identifier for the trace, globally unique, in 24 hexadecimal digits.    Trace IDs created via OpenTelemetry have a different format based on the  W3C Trace Context specification. A W3C trace ID must be formatted in the X-Ray trace ID format when sending to X-Ray. For example, a W3C trace ID 4efaaf4d1e8720b39541901950019ee5 should be formatted as  1-4efaaf4d-1e8720b39541901950019ee5 when sending to X-Ray. While X-Ray trace IDs include  the original request timestamp in Unix epoch time, this is not required or validated.
    ///
    /// Parameters:
    ///   - traceSegmentDocuments: A string containing a JSON document defining one or more segments or subsegments.
    ///   - logger: Logger use during operation
    @inlinable
    public func putTraceSegments(
        traceSegmentDocuments: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutTraceSegmentsResult {
        let input = PutTraceSegmentsRequest(
            traceSegmentDocuments: traceSegmentDocuments
        )
        return try await self.putTraceSegments(input, logger: logger)
    }

    ///  Initiates a trace retrieval process using the specified time range and for the give trace IDs on Transaction Search generated by the CloudWatch log group. For more information, see Transaction Search.
    ///  API returns a RetrievalToken, which can be used with ListRetrievedTraces or GetRetrievedTracesGraph to fetch results. Retrievals will time out after 60 minutes. To execute long time ranges, consider segmenting into multiple retrievals. If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to retrieve data from a linked source account, as long as both accounts have transaction search enabled. For retrieving data from X-Ray directly as opposed to the Transaction-Search Log group, see BatchGetTraces.
    @Sendable
    @inlinable
    public func startTraceRetrieval(_ input: StartTraceRetrievalRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartTraceRetrievalResult {
        try await self.client.execute(
            operation: "StartTraceRetrieval", 
            path: "/StartTraceRetrieval", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Initiates a trace retrieval process using the specified time range and for the give trace IDs on Transaction Search generated by the CloudWatch log group. For more information, see Transaction Search.
    ///  API returns a RetrievalToken, which can be used with ListRetrievedTraces or GetRetrievedTracesGraph to fetch results. Retrievals will time out after 60 minutes. To execute long time ranges, consider segmenting into multiple retrievals. If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to retrieve data from a linked source account, as long as both accounts have transaction search enabled. For retrieving data from X-Ray directly as opposed to the Transaction-Search Log group, see BatchGetTraces.
    ///
    /// Parameters:
    ///   - endTime:  The end of the time range to retrieve traces. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
    ///   - startTime:  The start of the time range to retrieve traces. The range is inclusive, so the specified start time is included in the query.  Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
    ///   - traceIds:  Specify the trace IDs of the traces to be retrieved.
    ///   - logger: Logger use during operation
    @inlinable
    public func startTraceRetrieval(
        endTime: Date,
        startTime: Date,
        traceIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartTraceRetrievalResult {
        let input = StartTraceRetrievalRequest(
            endTime: endTime, 
            startTime: startTime, 
            traceIds: traceIds
        )
        return try await self.startTraceRetrieval(input, logger: logger)
    }

    /// Applies tags to an existing Amazon Web Services X-Ray group or sampling rule.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/TagResource", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Applies tags to an existing Amazon Web Services X-Ray group or sampling rule.
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
    ///   - tags: A map that contains one or more tag keys and tag values to attach to an X-Ray group or sampling rule. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference. The following restrictions apply to tags:   Maximum number of user-applied tags per resource: 50   Maximum tag key length: 128 Unicode characters   Maximum tag value length: 256 Unicode characters   Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @   Tag keys and values are case sensitive.   Don't use aws: as a prefix for keys; it's reserved for Amazon Web Services use. You cannot edit or delete system tags.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceARN: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceARN: resourceARN, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from an Amazon Web Services X-Ray group or sampling rule. You cannot edit or delete system tags (those with an aws: prefix).
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/UntagResource", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from an Amazon Web Services X-Ray group or sampling rule. You cannot edit or delete system tags (those with an aws: prefix).
    ///
    /// Parameters:
    ///   - resourceARN: The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
    ///   - tagKeys: Keys for one or more tags that you want to remove from an X-Ray group or sampling rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceARN: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceARN: resourceARN, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates a group resource.
    @Sendable
    @inlinable
    public func updateGroup(_ input: UpdateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateGroupResult {
        try await self.client.execute(
            operation: "UpdateGroup", 
            path: "/UpdateGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a group resource.
    ///
    /// Parameters:
    ///   - filterExpression: The updated filter expression defining criteria by which to group traces.
    ///   - groupARN: The ARN that was generated upon creation.
    ///   - groupName: The case-sensitive name of the group.
    ///   - insightsConfiguration: The structure containing configurations related to insights.   The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.   The NotificationsEnabled boolean can be set to true to enable insights notifications for the group. Notifications can only be enabled on a group with InsightsEnabled set to true.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateGroup(
        filterExpression: String? = nil,
        groupARN: String? = nil,
        groupName: String? = nil,
        insightsConfiguration: InsightsConfiguration? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateGroupResult {
        let input = UpdateGroupRequest(
            filterExpression: filterExpression, 
            groupARN: groupARN, 
            groupName: groupName, 
            insightsConfiguration: insightsConfiguration
        )
        return try await self.updateGroup(input, logger: logger)
    }

    /// Modifies an indexing rule’s configuration.
    ///  Indexing rules are used for determining the sampling rate for spans indexed from CloudWatch Logs. For more information, see Transaction Search.
    @Sendable
    @inlinable
    public func updateIndexingRule(_ input: UpdateIndexingRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateIndexingRuleResult {
        try await self.client.execute(
            operation: "UpdateIndexingRule", 
            path: "/UpdateIndexingRule", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Modifies an indexing rule’s configuration.
    ///  Indexing rules are used for determining the sampling rate for spans indexed from CloudWatch Logs. For more information, see Transaction Search.
    ///
    /// Parameters:
    ///   - name:  Name of the indexing rule to be updated.
    ///   - rule:  Rule configuration to be updated.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateIndexingRule(
        name: String,
        rule: IndexingRuleValueUpdate,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateIndexingRuleResult {
        let input = UpdateIndexingRuleRequest(
            name: name, 
            rule: rule
        )
        return try await self.updateIndexingRule(input, logger: logger)
    }

    /// Modifies a sampling rule's configuration.
    @Sendable
    @inlinable
    public func updateSamplingRule(_ input: UpdateSamplingRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateSamplingRuleResult {
        try await self.client.execute(
            operation: "UpdateSamplingRule", 
            path: "/UpdateSamplingRule", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Modifies a sampling rule's configuration.
    ///
    /// Parameters:
    ///   - samplingRuleUpdate: The rule and fields to change.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateSamplingRule(
        samplingRuleUpdate: SamplingRuleUpdate,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateSamplingRuleResult {
        let input = UpdateSamplingRuleRequest(
            samplingRuleUpdate: samplingRuleUpdate
        )
        return try await self.updateSamplingRule(input, logger: logger)
    }

    ///  Modifies the destination of data sent to PutTraceSegments. The Transaction Search feature requires the CloudWatchLogs destination. For more information, see Transaction Search.
    @Sendable
    @inlinable
    public func updateTraceSegmentDestination(_ input: UpdateTraceSegmentDestinationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateTraceSegmentDestinationResult {
        try await self.client.execute(
            operation: "UpdateTraceSegmentDestination", 
            path: "/UpdateTraceSegmentDestination", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Modifies the destination of data sent to PutTraceSegments. The Transaction Search feature requires the CloudWatchLogs destination. For more information, see Transaction Search.
    ///
    /// Parameters:
    ///   - destination: The configured destination of trace segments.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateTraceSegmentDestination(
        destination: TraceSegmentDestination? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateTraceSegmentDestinationResult {
        let input = UpdateTraceSegmentDestinationRequest(
            destination: destination
        )
        return try await self.updateTraceSegmentDestination(input, logger: logger)
    }
}

extension XRay {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: XRay, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension XRay {
    /// Return PaginatorSequence for operation ``batchGetTraces(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func batchGetTracesPaginator(
        _ input: BatchGetTracesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<BatchGetTracesRequest, BatchGetTracesResult> {
        return .init(
            input: input,
            command: self.batchGetTraces,
            inputKey: \BatchGetTracesRequest.nextToken,
            outputKey: \BatchGetTracesResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``batchGetTraces(_:logger:)``.
    ///
    /// - Parameters:
    ///   - traceIds: Specify the trace IDs of requests for which to retrieve segments.
    ///   - logger: Logger used for logging
    @inlinable
    public func batchGetTracesPaginator(
        traceIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<BatchGetTracesRequest, BatchGetTracesResult> {
        let input = BatchGetTracesRequest(
            traceIds: traceIds
        )
        return self.batchGetTracesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getGroupsPaginator(
        _ input: GetGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetGroupsRequest, GetGroupsResult> {
        return .init(
            input: input,
            command: self.getGroups,
            inputKey: \GetGroupsRequest.nextToken,
            outputKey: \GetGroupsResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - logger: Logger used for logging
    @inlinable
    public func getGroupsPaginator(
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetGroupsRequest, GetGroupsResult> {
        let input = GetGroupsRequest(
        )
        return self.getGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getInsightEvents(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getInsightEventsPaginator(
        _ input: GetInsightEventsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetInsightEventsRequest, GetInsightEventsResult> {
        return .init(
            input: input,
            command: self.getInsightEvents,
            inputKey: \GetInsightEventsRequest.nextToken,
            outputKey: \GetInsightEventsResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getInsightEvents(_:logger:)``.
    ///
    /// - Parameters:
    ///   - insightId: The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
    ///   - maxResults: Used to retrieve at most the specified value of events.
    ///   - logger: Logger used for logging
    @inlinable
    public func getInsightEventsPaginator(
        insightId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetInsightEventsRequest, GetInsightEventsResult> {
        let input = GetInsightEventsRequest(
            insightId: insightId, 
            maxResults: maxResults
        )
        return self.getInsightEventsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getInsightSummaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getInsightSummariesPaginator(
        _ input: GetInsightSummariesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetInsightSummariesRequest, GetInsightSummariesResult> {
        return .init(
            input: input,
            command: self.getInsightSummaries,
            inputKey: \GetInsightSummariesRequest.nextToken,
            outputKey: \GetInsightSummariesResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getInsightSummaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - endTime: The end of the time frame in which the insights ended. The end time can't be more than 30 days old.
    ///   - groupARN: The Amazon Resource Name (ARN) of the group. Required if the GroupName isn't provided.
    ///   - groupName: The name of the group. Required if the GroupARN isn't provided.
    ///   - maxResults: The maximum number of results to display.
    ///   - startTime: The beginning of the time frame in which the insights started. The start time can't be more than 30 days old.
    ///   - states: The list of insight states.
    ///   - logger: Logger used for logging
    @inlinable
    public func getInsightSummariesPaginator(
        endTime: Date,
        groupARN: String? = nil,
        groupName: String? = nil,
        maxResults: Int? = nil,
        startTime: Date,
        states: [InsightState]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetInsightSummariesRequest, GetInsightSummariesResult> {
        let input = GetInsightSummariesRequest(
            endTime: endTime, 
            groupARN: groupARN, 
            groupName: groupName, 
            maxResults: maxResults, 
            startTime: startTime, 
            states: states
        )
        return self.getInsightSummariesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getSamplingRules(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getSamplingRulesPaginator(
        _ input: GetSamplingRulesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetSamplingRulesRequest, GetSamplingRulesResult> {
        return .init(
            input: input,
            command: self.getSamplingRules,
            inputKey: \GetSamplingRulesRequest.nextToken,
            outputKey: \GetSamplingRulesResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getSamplingRules(_:logger:)``.
    ///
    /// - Parameters:
    ///   - logger: Logger used for logging
    @inlinable
    public func getSamplingRulesPaginator(
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetSamplingRulesRequest, GetSamplingRulesResult> {
        let input = GetSamplingRulesRequest(
        )
        return self.getSamplingRulesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getSamplingStatisticSummaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getSamplingStatisticSummariesPaginator(
        _ input: GetSamplingStatisticSummariesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetSamplingStatisticSummariesRequest, GetSamplingStatisticSummariesResult> {
        return .init(
            input: input,
            command: self.getSamplingStatisticSummaries,
            inputKey: \GetSamplingStatisticSummariesRequest.nextToken,
            outputKey: \GetSamplingStatisticSummariesResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getSamplingStatisticSummaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - logger: Logger used for logging
    @inlinable
    public func getSamplingStatisticSummariesPaginator(
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetSamplingStatisticSummariesRequest, GetSamplingStatisticSummariesResult> {
        let input = GetSamplingStatisticSummariesRequest(
        )
        return self.getSamplingStatisticSummariesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getServiceGraph(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getServiceGraphPaginator(
        _ input: GetServiceGraphRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetServiceGraphRequest, GetServiceGraphResult> {
        return .init(
            input: input,
            command: self.getServiceGraph,
            inputKey: \GetServiceGraphRequest.nextToken,
            outputKey: \GetServiceGraphResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getServiceGraph(_:logger:)``.
    ///
    /// - Parameters:
    ///   - endTime: The end of the timeframe for which to generate a graph.
    ///   - groupARN: The Amazon Resource Name (ARN) of a group based on which you want to generate a graph.
    ///   - groupName: The name of a group based on which you want to generate a graph.
    ///   - startTime: The start of the time frame for which to generate a graph.
    ///   - logger: Logger used for logging
    @inlinable
    public func getServiceGraphPaginator(
        endTime: Date,
        groupARN: String? = nil,
        groupName: String? = nil,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetServiceGraphRequest, GetServiceGraphResult> {
        let input = GetServiceGraphRequest(
            endTime: endTime, 
            groupARN: groupARN, 
            groupName: groupName, 
            startTime: startTime
        )
        return self.getServiceGraphPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getTimeSeriesServiceStatistics(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getTimeSeriesServiceStatisticsPaginator(
        _ input: GetTimeSeriesServiceStatisticsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetTimeSeriesServiceStatisticsRequest, GetTimeSeriesServiceStatisticsResult> {
        return .init(
            input: input,
            command: self.getTimeSeriesServiceStatistics,
            inputKey: \GetTimeSeriesServiceStatisticsRequest.nextToken,
            outputKey: \GetTimeSeriesServiceStatisticsResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getTimeSeriesServiceStatistics(_:logger:)``.
    ///
    /// - Parameters:
    ///   - endTime: The end of the time frame for which to aggregate statistics.
    ///   - entitySelectorExpression: A filter expression defining entities that will be aggregated for statistics. Supports ID, service, and edge functions. If no selector expression is specified, edge statistics are returned.
    ///   - forecastStatistics: The forecasted high and low fault count values. Forecast enabled requests require the EntitySelectorExpression ID be provided.
    ///   - groupARN: The Amazon Resource Name (ARN) of the group for which to pull statistics from.
    ///   - groupName: The case-sensitive name of the group for which to pull statistics from.
    ///   - period: Aggregation period in seconds.
    ///   - startTime: The start of the time frame for which to aggregate statistics.
    ///   - logger: Logger used for logging
    @inlinable
    public func getTimeSeriesServiceStatisticsPaginator(
        endTime: Date,
        entitySelectorExpression: String? = nil,
        forecastStatistics: Bool? = nil,
        groupARN: String? = nil,
        groupName: String? = nil,
        period: Int? = nil,
        startTime: Date,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetTimeSeriesServiceStatisticsRequest, GetTimeSeriesServiceStatisticsResult> {
        let input = GetTimeSeriesServiceStatisticsRequest(
            endTime: endTime, 
            entitySelectorExpression: entitySelectorExpression, 
            forecastStatistics: forecastStatistics, 
            groupARN: groupARN, 
            groupName: groupName, 
            period: period, 
            startTime: startTime
        )
        return self.getTimeSeriesServiceStatisticsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getTraceGraph(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getTraceGraphPaginator(
        _ input: GetTraceGraphRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetTraceGraphRequest, GetTraceGraphResult> {
        return .init(
            input: input,
            command: self.getTraceGraph,
            inputKey: \GetTraceGraphRequest.nextToken,
            outputKey: \GetTraceGraphResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getTraceGraph(_:logger:)``.
    ///
    /// - Parameters:
    ///   - traceIds: Trace IDs of requests for which to generate a service graph.
    ///   - logger: Logger used for logging
    @inlinable
    public func getTraceGraphPaginator(
        traceIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetTraceGraphRequest, GetTraceGraphResult> {
        let input = GetTraceGraphRequest(
            traceIds: traceIds
        )
        return self.getTraceGraphPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``getTraceSummaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func getTraceSummariesPaginator(
        _ input: GetTraceSummariesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<GetTraceSummariesRequest, GetTraceSummariesResult> {
        return .init(
            input: input,
            command: self.getTraceSummaries,
            inputKey: \GetTraceSummariesRequest.nextToken,
            outputKey: \GetTraceSummariesResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``getTraceSummaries(_:logger:)``.
    ///
    /// - Parameters:
    ///   - endTime: The end of the time frame for which to retrieve traces.
    ///   - filterExpression: Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.
    ///   - sampling: Set to true to get summaries for only a subset of available traces.
    ///   - samplingStrategy: A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.
    ///   - startTime: The start of the time frame for which to retrieve traces.
    ///   - timeRangeType: Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).
    ///   - logger: Logger used for logging
    @inlinable
    public func getTraceSummariesPaginator(
        endTime: Date,
        filterExpression: String? = nil,
        sampling: Bool? = nil,
        samplingStrategy: SamplingStrategy? = nil,
        startTime: Date,
        timeRangeType: TimeRangeType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<GetTraceSummariesRequest, GetTraceSummariesResult> {
        let input = GetTraceSummariesRequest(
            endTime: endTime, 
            filterExpression: filterExpression, 
            sampling: sampling, 
            samplingStrategy: samplingStrategy, 
            startTime: startTime, 
            timeRangeType: timeRangeType
        )
        return self.getTraceSummariesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listResourcePolicies(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listResourcePoliciesPaginator(
        _ input: ListResourcePoliciesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListResourcePoliciesRequest, ListResourcePoliciesResult> {
        return .init(
            input: input,
            command: self.listResourcePolicies,
            inputKey: \ListResourcePoliciesRequest.nextToken,
            outputKey: \ListResourcePoliciesResult.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listResourcePolicies(_:logger:)``.
    ///
    /// - Parameters:
    ///   - logger: Logger used for logging
    @inlinable
    public func listResourcePoliciesPaginator(
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListResourcePoliciesRequest, ListResourcePoliciesResult> {
        let input = ListResourcePoliciesRequest(
        )
        return self.listResourcePoliciesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listTagsForResource(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listTagsForResourcePaginator(
        _ input: ListTagsForResourceRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListTagsForResourceRequest, ListTagsForResourceResponse> {
        return .init(
            input: input,
            command: self.listTagsForResource,
            inputKey: \ListTagsForResourceRequest.nextToken,
            outputKey: \ListTagsForResourceResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listTagsForResource(_:logger:)``.
    ///
    /// - Parameters:
    ///   - resourceARN: The Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
    ///   - logger: Logger used for logging
    @inlinable
    public func listTagsForResourcePaginator(
        resourceARN: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListTagsForResourceRequest, ListTagsForResourceResponse> {
        let input = ListTagsForResourceRequest(
            resourceARN: resourceARN
        )
        return self.listTagsForResourcePaginator(input, logger: logger)
    }
}

extension XRay.BatchGetTracesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.BatchGetTracesRequest {
        return .init(
            nextToken: token,
            traceIds: self.traceIds
        )
    }
}

extension XRay.GetGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetGroupsRequest {
        return .init(
            nextToken: token
        )
    }
}

extension XRay.GetInsightEventsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetInsightEventsRequest {
        return .init(
            insightId: self.insightId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension XRay.GetInsightSummariesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetInsightSummariesRequest {
        return .init(
            endTime: self.endTime,
            groupARN: self.groupARN,
            groupName: self.groupName,
            maxResults: self.maxResults,
            nextToken: token,
            startTime: self.startTime,
            states: self.states
        )
    }
}

extension XRay.GetSamplingRulesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetSamplingRulesRequest {
        return .init(
            nextToken: token
        )
    }
}

extension XRay.GetSamplingStatisticSummariesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetSamplingStatisticSummariesRequest {
        return .init(
            nextToken: token
        )
    }
}

extension XRay.GetServiceGraphRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetServiceGraphRequest {
        return .init(
            endTime: self.endTime,
            groupARN: self.groupARN,
            groupName: self.groupName,
            nextToken: token,
            startTime: self.startTime
        )
    }
}

extension XRay.GetTimeSeriesServiceStatisticsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetTimeSeriesServiceStatisticsRequest {
        return .init(
            endTime: self.endTime,
            entitySelectorExpression: self.entitySelectorExpression,
            forecastStatistics: self.forecastStatistics,
            groupARN: self.groupARN,
            groupName: self.groupName,
            nextToken: token,
            period: self.period,
            startTime: self.startTime
        )
    }
}

extension XRay.GetTraceGraphRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetTraceGraphRequest {
        return .init(
            nextToken: token,
            traceIds: self.traceIds
        )
    }
}

extension XRay.GetTraceSummariesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.GetTraceSummariesRequest {
        return .init(
            endTime: self.endTime,
            filterExpression: self.filterExpression,
            nextToken: token,
            sampling: self.sampling,
            samplingStrategy: self.samplingStrategy,
            startTime: self.startTime,
            timeRangeType: self.timeRangeType
        )
    }
}

extension XRay.ListResourcePoliciesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.ListResourcePoliciesRequest {
        return .init(
            nextToken: token
        )
    }
}

extension XRay.ListTagsForResourceRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> XRay.ListTagsForResourceRequest {
        return .init(
            nextToken: token,
            resourceARN: self.resourceARN
        )
    }
}
